package com.cdtu.service;

import com.cdtu.entity.Resource;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author Sakura
* @description 针对表【resource】的数据库操作Service
* @createDate 2023-01-08 12:29:11
*/
public interface ResourceService extends IService<Resource> {
    List<Resource> queryAll();
    List<Resource>queryByCategory(String category);
    int deleteById(String id);

    int addResource(Resource resource);

    Resource findById(String id);
    Resource findByName(String name);

    int addStockById(long id, int count);

    boolean updateById(Resource resource);

    List<Resource> findByPage(Integer pageNow, Integer rows);

    //查询总条数
    long findTotal();

    List<Resource> findResourceByPage(Integer pageNow, Integer rows,String category);

    //查询总条数
    long findResourceTotal(String category);

    List<Resource> findByNamePage(Integer pageNow, Integer rows,String name);

    //查询总条数
    long findByNameTotal(String name);
}
